package cn.jsu.oj.dispatchServer.handle.handles;


import cn.jsu.oj.dispatchServer.handle.CommandPack;
import cn.jsu.oj.dispatchServer.parsing.HandleType;
import cn.jsu.oj.dispatchServer.pojo.TaskInfo;
import cn.jsu.oj.dispatchServer.resource.Resource;
import lombok.extern.slf4j.Slf4j;

/**
 * @author 24987
 */
@Slf4j
@HandleType(type = 12)
public class TaskInfoHandle implements Handle {
    //将任务发来，将任务塞入当前大队列
    @Override
    public CommandPack<?> handle(CommandPack<?> pack) {
        if (Resource.taskBigQueue.size() < 100024) {
            TaskInfo data = (TaskInfo) pack.getData();
            Resource.taskBigQueue.add(data);
            log.info("流水号-------------------" + data.getSerialNumber());
        } else {

        }
        return null;
    }
}
